//global root "W:\Lab\Lab-heimb\Montenovo\Volunteering Paper\Data"
global root "/Volumes/Workgroup/Lab/Lab-heimb/Montenovo/Volunteering Paper/Data/"
global results "$root/07_results/RR/main"
global dictionaries "$root/Dictionaries"

cd "$dictionaries"
capture log close
log using descriptive_stats, replace

cd "$root"

use appended_analytic_010305111719, clear
tab year 

eststo extensive_margin: reghdfe whether_volunteer_person  taxprice post_tax_income hourly_wage_aftertax full_time age sex  married black native_amer asian other hispanic HS some_college college_grad college_plus children  religion rural, noabsorb vce(cluster state)

gen sample=e(sample) 

cd "$results"

gen female=0
replace female=1 if sex==2

keep if sample==1

gen hours_volunteer_person_nozero=hours_volunteer_person if hours_volunteer_person!=.
replace hours_volunteer_person_nozero=. if hours_volunteer_person_nozero==0

sum2docx whether_volunteer_person hours_volunteer_person hours_volunteer_person_nozero taxprice  hourly_wage_aftertax full_time post_tax_income taxable_inc_hh_gen age married female LHS HS some_college college_grad college_plus white black native_amer asian  other hispanic  children religion rural using "$results/descriptive_stats_nolabels.docx", stats(N mean(%9.2f) sd(%9.2f) min(%9.0g) max(%9.0g)) replace title("Summary Statistics")

tab female
tab married
tab age

gen age_16_30=0
replace age_16_30=1 if age>15 & age<31
gen age_31_45=0
replace age_31_45=1 if age>30 & age<46
gen age_46_59=0
replace age_46_59=1 if age>45 & age<60
gen age_60_more=0
replace age_60_more=1 if age>59

bysort female: sum whether_volunteer_person
bysort married: sum whether_volunteer_person
bysort age_16_30: sum whether_volunteer_person
bysort age_31_45: sum whether_volunteer_person
bysort age_46_59: sum whether_volunteer_person
bysort age_60_more: sum whether_volunteer_person

bysort female: sum hours_volunteer_person_nozero
bysort married: sum hours_volunteer_person_nozero
bysort age_16_30: sum hours_volunteer_person_nozero
bysort age_31_45: sum hours_volunteer_person_nozero
bysort age_46_59: sum hours_volunteer_person_nozero
bysort age_60_more: sum hours_volunteer_person_nozero

sum whether_volunteer_person if year==2016
tab hours_volunteer_person year
tab year

cd "$dictionaries"
log close
